﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Name="window" x:Class="MainWindow"
    Title="MainWindow" Height="350" Width="525">
    <Grid>
    	<Grid.RowDefinitions>
    		<RowDefinition Height="24"/>
    		<RowDefinition/>
    	</Grid.RowDefinitions>
    	<Menu>
    		<MenuItem Header="文件">
    			<MenuItem Header="新建" Command="ApplicationCommands.New"/>
    			<MenuItem Header="打开" Command="ApplicationCommands.Open"/>
    			<MenuItem Header="保存" Command="ApplicationCommands.Save"/>
    			<MenuItem Header="另存为" Command="ApplicationCommands.SaveAs"/>
    			<Separator/>
    			<MenuItem Header="导入节点图片"/>
    			<Separator/>
    			<MenuItem Header="退出" Command="ApplicationCommands.Close"/>
    		</MenuItem>
    		<MenuItem Header="编辑">
    			<MenuItem Header="编辑源节点"/>
    			<MenuItem Header="编辑目标节点"/>
    			<Separator/>
    			<MenuItem Header="排序"/>
    		</MenuItem>
    		<MenuItem Header="帮助">
    			<MenuItem Header="关于"/>
    		</MenuItem>
    	</Menu>
    	<TabControl Margin="8" Grid.Row="1" TabStripPlacement="Left" DataContext="{Binding CurrentGraph, ElementName=window}">
    		<TabItem Header="Graph" HeaderTemplate="{DynamicResource TabItemHeader}">
    			<Grid Background="#FFE5E5E5"/>
    		</TabItem>
    		<TabItem Header="Nodes" HeaderTemplate="{DynamicResource TabItemHeader}">
    			<Grid Background="#FFE5E5E5">
    				<Grid.RowDefinitions>
    					<RowDefinition/>
    					<RowDefinition Height="40"/>
    					<RowDefinition Height="39.892"/>
    					<RowDefinition Height="35.108"/>
    				</Grid.RowDefinitions>
    				<Grid.ColumnDefinitions>
    					<ColumnDefinition Width="89.115"/>
    					<ColumnDefinition Width="88.364"/>
    					<ColumnDefinition Width="87.543"/>
    					<ColumnDefinition/>
    				</Grid.ColumnDefinitions>
    				<ListBox x:Name="NodeListBox" Margin="8" ItemsSource="{Binding CurrentGraph.Nodes, ElementName=window}" ItemTemplate="{DynamicResource NodeDataTemplate}" Grid.ColumnSpan="4"/>
    				<Button Content="添加节点" Margin="8,5.163,8,8" Grid.Row="3" d:LayoutOverrides="Height" Click="Add_Node"/>
    				<Button Content="删除节点" Grid.Column="1" Margin="8,5.163,8,8" Grid.Row="3" d:LayoutOverrides="Height" Click="Delete_Node"/>
    				<Button Content="编辑节点" Grid.Column="2" Margin="12.791,5.163,8,8" Grid.Row="3" d:LayoutOverrides="Height" Click="Edit_Node" IsEnabled="False"/>
    				<Label Content="节点名称" Margin="8" Grid.Row="1" d:LayoutOverrides="Height"/>
    				<Button Content="更改图片" Margin="8" Grid.Row="2" Click="Change_NodePicture"/>
    				<TextBox Grid.ColumnSpan="3" Grid.Column="1" Margin="8" Grid.Row="1" TextWrapping="Wrap" Text="{Binding SelectedItem.Name, ElementName=NodeListBox}"/>
    				<TextBox Grid.ColumnSpan="3" Grid.Column="1" Margin="8" Grid.Row="2" TextWrapping="Wrap" Text="{Binding SelectedItem.Image, ElementName=NodeListBox}"/>
    			</Grid>
    		</TabItem>
    		<TabItem Header="Edges" HeaderTemplate="{DynamicResource TabItemHeader}">
    			<Grid Background="#FFE5E5E5">
    				<ListBox x:Name="EdgeListBox" Margin="8,8,8,67" ItemTemplate="{DynamicResource EdgeDataTemplate}" ItemsSource="{Binding CurrentGraph.Edges, ElementName=window}"/>
    			</Grid>
    		</TabItem>
    	</TabControl>
        
    </Grid>
</Window>
